<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>场地操作</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/>
    <link rel="stylesheet" href="./css/font.css">
    <link rel="stylesheet" href="./css/xadmin.css">
    <link rel="stylesheet" href="https://cdn.bootcss.com/Swiper/3.4.2/css/swiper.min.css">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript" src="https://cdn.bootcss.com/Swiper/3.4.2/js/swiper.jquery.min.js"></script>
    <script src="./lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="./js/xadmin.js"></script>

</head>
<body>
<!-- 顶部开始 -->
<div th:replace="common::#topbar"></div>
<!-- 顶部结束 -->
<!-- 中部开始 -->
<div class="wrapper">
    <!-- 左侧菜单开始 -->
    <div th:replace="common::#leftbar"></div>
    <!-- 左侧菜单结束 -->
    <!-- 右侧主体开始 -->
    <div class="page-content">
        <div class="content">
            <!-- 右侧内容框架，更改从这里开始 -->
            <xblock>
                <a style="color: chartreuse" th:href="@{/toadd-place}">
                      <span class="layui-btn layui-btn-normal layui-btn-mini">
                             <i class="layui-icon">&#xe608;</i> 添加场地
                    </span>

                </a>
            </xblock>
            <fieldset class="layui-elem-field layui-field-title site-title">
                <legend><a name="default">赛事场地操作</a></legend>
            </fieldset>


            <span class="x-right" style="line-height:40px">共有数据：[[${account}]] 条</span>

            <table class="layui-table">
                <thead>
                <tr>
                    <th style="text-align: center">场地编号</th>
                    <th style="text-align: center">场地地址</th>
                    <th style="text-align: center">赛事房间</th>
                    <th style="text-align: center">安全等级</th>
                    <th style="text-align: center">场地修改</th>
                    <th style="text-align: center">场地删除</th>
                </tr>
                </thead>
                <tbody>
                <tr align="center" th:each="palce:${placeList}">
                    <td th:text="${palce.id}">场地编号</td>
                    <td th:text="${palce.address}">场地地址</td>
                    <td th:text="${palce.room}">赛事房间</td>
                    <td th:text="${palce.safe}">安全等级</td>
                    <td class="td-manage">
                        <a th:href="@{'/toupdate-palce?id='+${palce.id}}">
                            <i class="layui-icon">&#xe642;</i>
                        </a>
                    </td>
                    <td class="td-manage">
                        <a th:href="@{'/todelect-palce?id='+${palce.id}}" onclick="return deleteInfo()">
                            <i class="layui-icon">&#xe640;</i>
                        </a>
                    </td>
                </tr>
                </tbody>
            </table>
            <!-- 右侧内容框架，更改从这里结束 -->
        </div>
    </div>
    <!-- 右侧主体结束 -->
</div>
<!-- 中部结束 -->
<!-- 底部开始 -->
<div th:replace="common::#bottombar"></div>
<!-- 底部结束 -->
<!-- 背景切换开始 -->
<div th:replace="common::#backbar"></div>
<!-- 背景切换结束 -->
</body>

<script>
    function deleteInfo() {
        const r = confirm("确认删除此信息吗？");
        if (r == true) {
            alert("删除成功");
            return true;
        }
        return false;
    }
</script>
</html>